<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------

namespace app\user_center\model\user;

use think\Model;

/**
 * 行业 模型
 * @package app\user_center\model
 */
class BaseIndustryClassification extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'xm_base_industry_classification';
	

	/**
     * 添加用户微信数据
     * @param string $title     标题
     * @param int $sort 		排序
     * @author shiqiang <976162041@qq.com>
     * @return array
     */
	public function addData($title, $sort){
		$this->title 	= $title;
		$this->sort		= $sort;
        $res = $this -> isUpdate(false) -> save();//添加  thinkphp主键bug
        if($res){
            return array_out(200, 'success');
        }else{
            return array_out(-1001, 'error');
        }
    }
    
    public function deleteData($id){
		$map = [];
		$map['id'] 		= $id;
        $res = $this -> destroy($map);
        if($res){
            return array_out(200, 'success');
        }else{
            return array_out(-1001, 'error');
        }
	}
}
